package banco.contas;

import java.util.List;

import banco.exception.SaldoLimiteIndisponivelException;

public class ContaEspecial extends Conta {
	private double limite;

	public double getLimite() {
		return limite;
	}

	public void setLimite(double limite) {
		this.limite = limite;
	}

	@Override
	public void sacar(double valor) throws SaldoLimiteIndisponivelException {
		if (valor <= this.limite) {
			super.sacar(valor);
		} else {
			SaldoLimiteIndisponivelException e = new SaldoLimiteIndisponivelException(
					this.limite);
			throw e;
		}
	}

	public ContaEspecial() {
		super();
	}

	public ContaEspecial(Agencia agencia, int numero, Pessoa titular,double saldo,double limite,String senha, 
			double taxaManutencao,double taxaBasica, double taxaSaque, double taxaTransferencia, double taxaDeposito,List<Movimentacao> historico) {
		super(agencia, numero, titular, saldo, senha, taxaManutencao,
				taxaBasica, taxaSaque, taxaTransferencia, taxaDeposito, historico);
		this.limite = limite;
	}
}
